package com.xnyzc.lhy.order.controller.dapi.order;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.common.exception.PangException;
import com.xnyzc.lhy.common.penum.EErrorCode;
import com.xnyzc.lhy.common.util.CheckUtil;
import com.xnyzc.lhy.common.util.TokenUtil;
import com.xnyzc.lhy.order.entity.param.order.OrderInfoParam;
import com.xnyzc.lhy.order.service.order.OaDOrderOperationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 司机订单操作相关控制器
 *
 * @Author: wangshuo
 * @Date: 2019-10-31 14:11
 * @Description:
 */
@RestController
@RequestMapping("/oa/dapi/orderOperation")
public class OaDOrderOperationController {

    @Autowired
    private OaDOrderOperationService oaDOrderOperationService;

    /**
     * 司机端取消订单
     *
     * @return
     */
    @ApiOperation(value = "司机端取消订单", notes = "司机端取消订单")
    @PostMapping(value = "/dOrderCancel")
    public Rv dOrderCancel(
            @RequestBody OrderInfoParam orderInfoParam
    ) {
        if (CheckUtil.objIsEmpty(orderInfoParam)) {
            throw PangException.create(EErrorCode.missingArg);
        }
        return oaDOrderOperationService.dOrderCancel(orderInfoParam);
    }

}
